{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<center><img src=\"./image/CLBLOGO.jpg\" alt=\"创乐博\" style=\"width: 300px;\"/></center>\n",
    "\n",
    "# 3.机器人基本运动\n",
    "\n",
    "@－－－－湖南创乐博智能科技有限公司－－－－<br>\n",
    "@  文件名：3.机器人基本运动.py <br>\n",
    "@  版本：V2.0 <br>\n",
    "@  author: zhulin<br>\n",
    "@  说明：机器人基本运动\n",
    "机器人基本运动！<br>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 机器人基本控制库测试"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'\\nif __name__ == \"__main__\":\\n    clbrobot = LOBOROBOT() # 实例化机器人对象\\n    try:\\n        while True:\\n            clbrobot.t_up(50,3)      # 机器人前进\\n            #clbrobot.t_stop(1) # 机器人停止\\n            #clbrobot.t_down(50,3)    # 机器人后退\\n            #clbrobot.t_stop(1) # 机器人停止\\n            #clbrobot.turnLeft(50,3)  # 机器人左转\\n            #clbrobot.t_stop(1) # 机器人停止\\n            #clbrobot.turnRight(50,3) # 机器人右转\\n            #clbrobot.t_stop(1) # 机器人停止\\n            #clbrobot.moveLeft(50,3)  # 机器人左移\\n            #clbrobot.t_stop(1) # 机器人停止\\n            #clbrobot.moveRight(50,3) # 机器人右移\\n            #clbrobot.t_stop(1) # 机器人停止\\n            #clbrobot.forward_Left(50,3) # 机器人前左斜\\n            #clbrobot.t_stop(1) # 机器人停止\\n            #clbrobot.backward_Right(50,3) # 机器人后右斜\\n            #clbrobot.t_stop(1) # 机器人停止\\n            #clbrobot.forward_Right(50,3)  # 机器人前右斜\\n            #clbrobot.t_stop(1) # 机器人停止\\n            #clbrobot.backward_Left(50,3)  # 机器人后左斜\\n            #clbrobot.t_stop(5)       # 机器人停止            \\n    except KeyboardInterrupt:\\n        clbrobot.t_stop(0) # 机器人停止\\n'"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from LOBOROBOT import LOBOROBOT  # 载入机器人库\n",
    "\n",
    "import os\n",
    "\n",
    "if __name__ == \"__main__\":\n",
    "    clbrobot = LOBOROBOT() # 实例化机器人对象\n",
    "    try:\n",
    "        while True:\n",
    "            clbrobot.t_up(50,3)      # 机器人前进\n",
    "            clbrobot.t_stop(1) # 机器人停止\n",
    "            clbrobot.t_down(50,3)    # 机器人后退\n",
    "            clbrobot.t_stop(1) # 机器人停止\n",
    "            clbrobot.turnLeft(50,3)  # 机器人左转\n",
    "            clbrobot.t_stop(1) # 机器人停止\n",
    "            clbrobot.turnRight(50,3) # 机器人右转\n",
    "            clbrobot.t_stop(1) # 机器人停止\n",
    "            clbrobot.moveLeft(50,3)  # 机器人左移\n",
    "            clbrobot.t_stop(1) # 机器人停止\n",
    "            clbrobot.moveRight(50,3) # 机器人右移\n",
    "            clbrobot.t_stop(1) # 机器人停止\n",
    "            clbrobot.forward_Left(50,3) # 机器人前左斜\n",
    "            clbrobot.t_stop(1) # 机器人停止\n",
    "            clbrobot.backward_Right(50,3) # 机器人后右斜\n",
    "            clbrobot.t_stop(1) # 机器人停止\n",
    "            clbrobot.forward_Right(50,3)  # 机器人前右斜\n",
    "            clbrobot.t_stop(1) # 机器人停止\n",
    "            clbrobot.backward_Left(50,3)  # 机器人后左斜\n",
    "            clbrobot.t_stop(5)       # 机器人停止            \n",
    "    except KeyboardInterrupt:\n",
    "        clbrobot.t_stop(0) # 机器人停止"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
